package com.antdesignbackend.backend.service.impl;

import com.antdesignbackend.backend.entity.UserRoles;
import com.antdesignbackend.backend.entity.entityVo.UserRoleVo;
import com.antdesignbackend.backend.mapper.UserRolesMapper;
import com.antdesignbackend.backend.service.UserRolesService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserRolesServiceImpl extends ServiceImpl<UserRolesMapper, UserRoles> implements UserRolesService {
    @Autowired
    UserRolesMapper UserRolesMapper;

    @Override
    public List<UserRoleVo> selectUserRoleList(QueryWrapper<UserRoleVo> queryWrapper, Page<UserRoleVo> page) {
        List<UserRoleVo> userRoleVos = UserRolesMapper.selectUserRoleList(queryWrapper, page);
        return userRoleVos;
    }

    @Override
    public Integer count(QueryWrapper<UserRoleVo> queryWrapper) {
        return UserRolesMapper.count(queryWrapper);
    }
}
